﻿namespace StateMachine
{
    internal class Program
    {
        static void Main(string[] args)
        {
            // 初始化状态机
            OrderStateMachine orderStateMachine = new OrderStateMachine();

            // 尝试支付
            orderStateMachine.Pay();     

            // 尝试发货
            orderStateMachine.Ship();   

            // 尝试完成订单
            orderStateMachine.Complete(); 

            // 尝试取消订单
            orderStateMachine.Cancel();

            Console.Read();
        }
    }
}
